from qbank.models import dialog, quesAns, userBkView, userView, course
from django.contrib import admin
from django.forms import TextInput
from django.db import models

#TinyMCE Editor
class RichText:
	js = ('/static/tinymce/jscripts/tiny_mce/tiny_mce.js', '/static/tinymce/jscripts/tiny_mce/rt.js',)

class CourseAdmin(admin.ModelAdmin):
	formfield_overrides = {
	        models.CharField: {'widget': TextInput(attrs={'size':'50'})},
	}

class QuestionInline(admin.StackedInline):
	model = quesAns
	extra = 1
	Media = RichText

class DialogAdmin(admin.ModelAdmin):
	formfield_overrides = {
        	models.CharField: {'widget': TextInput(attrs={'size':'90'})},
    	}
	inlines = [QuestionInline]

admin.site.register(dialog, DialogAdmin)
admin.site.register(course, CourseAdmin)
admin.site.register(userBkView)
admin.site.register(userView)
